<template>
  <q-menu>
    <q-list dense>
      <q-item
        clickable
        v-close-popup
        @click="
          () => {
            emit('report');
          }
        "
        v-if="webStore.userInfo.id != item.userId"
      >
        <q-item-section>举报</q-item-section>
      </q-item>
      <q-separator />
      <q-item
        v-if="webStore.userInfo.id == item.userId"
        @click="
          () => {
            emit('del');
          }
        "
        clickable
        v-close-popup
      >
        <q-item-section>删除</q-item-section>
      </q-item>
      <q-item
        @click="
          () => {
            emit('copy');
          }
        "
        clickable
        v-close-popup
      >
        <q-item-section>复制</q-item-section>
      </q-item>
    </q-list>
  </q-menu>
</template>

<script setup lang="ts">
import { useWebStore } from 'src/stores/webStore';
const webStore = useWebStore();

defineProps<{
  item: Api.CommentVO;
}>();

const emit = defineEmits<{
  (e: 'report'): void;
  (e: 'del'): void;
  (e: 'copy'): void;
}>();
</script>

<style scoped></style>
